<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://hyperf.wiki
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf/hyperf/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;

Router::addServer('ws', function () {
    Router::get('/', 'App\Controller\Api\V1\WebSocketController');
    Router::post('/init', 'App\Controller\Api\V1\WebSocketController@onRequest');
});

Router::get('/favicon.ico', function () {
    return '';
});
Router::get('/test', 'App\Controller\IndexController@test');
Router::addGroup('/v1/user/', function () {
    Router::post('register', 'App\Controller\Api\V1\UserController@index');
    Router::post('login', 'App\Controller\Api\V1\UserController@login');
    Router::get('user-info', 'App\Controller\Api\V1\UserController@userInfo');
    Router::post('user-save', 'App\Controller\Api\V1\UserController@save');
});

Router::addGroup('/v1/tpl/', function () {
    Router::get('list', 'App\Controller\Api\V1\MeetingTplController@allMeetingTpl');
    Router::post('store/{tplId:\d+}', 'App\Controller\Api\V1\MeetingTplController@save');
    Router::get('del/{tplId:\d+}', 'App\Controller\Api\V1\MeetingTplController@delTpl');
});

Router::addGroup('/v1/meeting/', function () {
    Router::post('store/{id:\d+}', 'App\Controller\Api\V1\MeetingController@save');
    Router::post('info', 'App\Controller\Api\V1\MeetingController@findInfo');
    Router::post('del-meeting', 'App\Controller\Api\V1\MeetingController@deleteMeeting');
    Router::get('user-all-meeting', 'App\Controller\Api\V1\MeetingController@allUserMeetingsInfo');
    Router::get('all-meeting', 'App\Controller\Api\V1\MeetingController@allNoFinishMeetings');
    Router::post('cancel-meeting', 'App\Controller\Api\V1\MeetingController@cancelMeeting');
});

Router::addGroup('/v1/sign/', function () {
    Router::get('take-part-in', 'App\Controller\Api\V1\SignController@takePartIn');
});
